<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="cw" uri="/widget-tags"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
  	//模拟字典缓存
  	java.util.Map dic = new java.util.HashMap();
  	dic.put("dicSex", "[[1,'男'],[2,'女']]");
  	application.setAttribute("dic", dic);
  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<cw:base />
		<script type="text/javascript">
			function getSexData() {
				return [ [ 1, '男' ], [ 2, '女' ] ];
			}
			
			function showImage(v,m,r) {
		 		return "<img src=<s:url value='/'/>" + v + "></img>";
		  	}
		</script>
	</head>
	<body>
		<ul>
			<li>
				<cw:fieldSet title="自定义表格" content="selfDefinitionGridDiv" collapsible="true" collapsed="false"/>
				<div id="selfDefinitionGridDiv">
					<cw:editGrid id="selfDefinitionGrid" title="" url="${pageContext.request.contextPath }/sample/grid/selfDefinitionGrid.action"
				  		exportable="false" enablePage="false" urlParams="{initPageSize:20}" stripeRows="true" width="1100" 
				  		stripleColor="#DBEEF4" autoLoad="true" loadMask="true" forceFit="false" pageSize="500" enableHdMenu="false"
				  		enableColumnMove="false">
				  		<cw:toolBar>
				  			<cw:actionButton type="add" title="添加" split="true"></cw:actionButton>
				  			<cw:actionButton type="delete" title="删除" split="true" url="${pageContext.request.contextPath }/sample/grid/editgrid.delete.action" 
				  			    waitMsg="正在删除数据..."/>
				  			<cw:actionButton type="remove" title="移除(统一删除)" split="true"/>
				  			<cw:actionButton type="update" title="保存" split="true" url="${pageContext.request.contextPath }/sample/grid/editgrid.update.action" 
				  			    waitMsg="正在保存数据..."/>
				  			<cw:actionButton type="" action="alert('总记录:'+Ext.getCmp('selfDefinitionGrid').getStore().getTotalCount());" 
				  			    title="记录总数"/>
				  			<%-- <cw:actionButton type="copy" title="复制"/>--%>
				  		</cw:toolBar>
				  		<cw:indexColumn indexWidth="40" title=""/>
				   		<cw:gridColumn property="a" editable="true" editorType="string" width="100" title="A" align="center" sortable="false" enableTooltip="true"/>
				   		<cw:gridColumn property="b" editable="true" editorType="string" width="100" title="B" align="center" sortable="false" enableTooltip="true"/>  		
				  		<cw:gridColumn property="c" editable="true" editorType="string" width="100" title="C" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="e" editable="true" editorType="string" width="100" title="D" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="e" editable="true" editorType="string" width="100" title="E" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="f" editable="true" editorType="string" width="100" title="F" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="g" editable="true" editorType="string" width="100" title="G" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="h" editable="true" editorType="string" width="100" title="H" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="i" editable="true" editorType="string" width="100" title="I" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="j" editable="true" editorType="string" width="100" title="J" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="k" editable="true" editorType="string" width="100" title="K" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="l" editable="true" editorType="string" width="100" title="L" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="m" editable="true" editorType="string" width="100" title="M" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="n" editable="true" editorType="string" width="100" title="N" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="o" editable="true" editorType="string" width="100" title="O" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="p" editable="true" editorType="string" width="100" title="P" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="q" editable="true" editorType="string" width="100" title="Q" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="r" editable="true" editorType="string" width="100" title="R" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="s" editable="true" editorType="string" width="100" title="S" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="t" editable="true" editorType="string" width="100" title="T" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="u" editable="true" editorType="string" width="100" title="U" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="v" editable="true" editorType="string" width="100" title="V" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="w" editable="true" editorType="string" width="100" title="W" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="x" editable="true" editorType="string" width="100" title="X" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="y" editable="true" editorType="string" width="100" title="Y" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="z" editable="true" editorType="string" width="100" title="Z" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="aa" editable="true" editorType="string" width="100" title="AA" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="ab" editable="true" editorType="string" width="100" title="AB" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="ac" editable="true" editorType="string" width="100" title="AC" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="ad" editable="true" editorType="string" width="100" title="AD" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="ae" editable="true" editorType="string" width="100" title="AE" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="af" editable="true" editorType="string" width="100" title="AF" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="ag" editable="true" editorType="string" width="100" title="AG" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="ah" editable="true" editorType="string" width="100" title="AH" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="ai" editable="true" editorType="string" width="100" title="AI" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="aj" editable="true" editorType="string" width="100" title="AJ" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="ak" editable="true" editorType="string" width="100" title="AK" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="al" editable="true" editorType="string" width="100" title="AL" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="am" editable="true" editorType="string" width="100" title="AM" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="an" editable="true" editorType="string" width="100" title="AN" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="ao" editable="true" editorType="string" width="100" title="AO" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="ap" editable="true" editorType="string" width="100" title="AP" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="aq" editable="true" editorType="string" width="100" title="AQ" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="ar" editable="true" editorType="string" width="100" title="AR" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="as" editable="true" editorType="string" width="100" title="AS" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="at" editable="true" editorType="string" width="100" title="AT" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="au" editable="true" editorType="string" width="100" title="AU" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="av" editable="true" editorType="string" width="100" title="AV" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="aw" editable="true" editorType="string" width="100" title="AW" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="ax" editable="true" editorType="string" width="100" title="AX" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="ay" editable="true" editorType="string" width="100" title="AY" align="center" sortable="false" enableTooltip="true"/>
				  		<cw:gridColumn property="az" editable="true" editorType="string" width="100" title="AZ" align="center" sortable="false" enableTooltip="true"/>
				  	</cw:editGrid>
				</div>
			</li>
		</ul>
		<cw:theme></cw:theme>
		<script type="text/javascript">
			Ext.onReady(function(){
				var STORE1 = Ext.getCmp('selfDefinitionGrid').store;
				STORE1.on("load",function(s,r,o){
					resetHeight("selfDefinitionGridFrame");
			    });
				resetHeight("selfDefinitionGridFrame");
			})
		
			function resetHeight(frame) {
				var ifm = parent.document.getElementById(frame);
				var obj = document.body;
				var oStyle = obj.currentStyle? obj.currentStyle : window.getComputedStyle(obj, false);
				var initHeight = parseInt(document.body.clientHeight+parseInt(oStyle["margin-top"])+parseInt(oStyle["margin-bottom"]));
				ifm.height = parseInt(initHeight);
			}
		</script>
	</body>
</html>